package game.assets;

import hx.assets.Future;
import hx.assets.Assets;

/**
 * 幻想纹章资源管理
 */
class HxwzAssets extends Assets {
	/**
	 * 角色资源
	 */
	public var roles:Map<String, RoleAssets> = [];

	override function onCompleted(future:Future<Dynamic, Dynamic>, data:Dynamic) {
		if (data is RoleAssets) {
			Assets.CURRENT_LOAD_COUNTS--;
			loadedCounts++;
			roles[Assets.formatName(future.getLoadData())] = data;
			if (loadedCounts == totalCounts) {
				this.completeValue(this);
				Assets.__assets.remove(this);
				this.stop();
				return;
			}
			if (loading)
				Assets.readyLoadNext();
			return;
		}
		super.onCompleted(future, data);
	}
}
